package com.jfl.core.listener;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.ContextStoppedEvent;

import com.jfl.listener.ApplicationReadyListener;

/**
 * JFL WEB 监听器
 *  
 * @author  赵炎
 * @version  [V1.00, 2018年12月3日]
 * @see  [相关类/方法]
 * @since V1.00
 */
@Configuration
public class JflPlatformWebListener extends ApplicationReadyListener
{
    @Override
    public void onApplicationEvent(ApplicationEvent event)
    {
        if (event instanceof ContextStoppedEvent)
        {
            // 应用停止
            //ProtocolConfig.destroyAll();
        }
        else if (event instanceof ContextClosedEvent)
        {
            // 应用关闭
            //ProtocolConfig.destroyAll();
        }
        super.onApplicationEvent(event);
    }
}
